/********************************************************************************
 *      Copyright:  (C) 2020 makun<1394987689@qq.com>
 *                  All rights reserved.
 *
 *       Filename:  sht20.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(13/07/20)
 *         Author:  makun <1394987689@qq.com>
 *      ChangeLog:  1, Release initial version on "13/07/20 04:38:15"
 *                 
 ********************************************************************************/

#ifndef __SHT20_H_
#define __SHT20_H_

#include <stdio.h> 
#include <fcntl.h> 
#include <unistd.h> 
#include <sys/ioctl.h> 
#include <linux/types.h> 
#include <sys/stat.h> 
#include <linux/i2c.h> 
#include <linux/i2c-dev.h> 
#include <stdio.h> 
#include <stdlib.h>
#include <sys/types.h> 
#include <string.h> 
#include <stdint.h> 
#include <time.h> 
#include <errno.h> 
#include <string.h>
#define SOFTRESET                        0xFE 
#define TRIGGER_TEMPERATURE_NO_HOLD      0xF3   //监测温度
#define TRIGGER_HUMIDITY_NO_HOLD         0xF5   //监测湿度

#define I2C_API_RDWR /*  Use I2C userspace driver read/write API */

static inline void msleep(unsigned long ms); 
static inline void dump_buf(const char *prompt, uint8_t *buf, int size); 
int sht2x_init(void); 
int sht2x_softreset(int fd); 
int sht2x_get_serialnumber(int fd, uint8_t *serialnumber, int size); 
int sht2x_get_temp_humidity(int fd, float **temp, float **rh); 

int get_temp_humidity( float *temp, float *humidity);


#endif
